home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / UPDATE- Int&Libs 3.2 / CIncludes / UnicodeUtilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-25  |  20.8 KB  |  536 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        UnicodeUtilities.h
  3.  
  4.      Contains:    Types, constants, prototypes for Unicode Utilities (Unicode input and text utils)
  5.  
  6.      Version:    Technology:    Allegro
  7.                  Release:    Veronica Seed, Use with 3.2 Universal Interfaces
  8.  
  9.      Copyright:    © 1997-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __UNICODEUTILITIES__
  18. #define __UNICODEUTILITIES__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __MACLOCALES__
  24. #include <MacLocales.h>
  25. #endif
  26.  
  27.  
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. #if PRAGMA_IMPORT
  37. #pragma import on
  38. #endif
  39.  
  40. #if PRAGMA_STRUCT_ALIGN
  41.     #pragma options align=mac68k
  42. #elif PRAGMA_STRUCT_PACKPUSH
  43.     #pragma pack(push, 2)
  44. #elif PRAGMA_STRUCT_PACK
  45.     #pragma pack(2)
  46. #endif
  47.  
  48. /*
  49.    -------------------------------------------------------------------------------------------------
  50.    CONSTANTS & DATA STRUCTURES for UCKeyTranslate & UCKeyboardLayout ('uchr' resource)
  51.    -------------------------------------------------------------------------------------------------
  52. */
  53.  
  54. /*
  55.    -------------------------------------------------------------------------------------------------
  56.    UCKeyOutput & related stuff
  57.    The interpretation of UCKeyOutput depends on bits 15-14.
  58.    If they are 01, then bits 0-13 are an index in UCKeyStateRecordsIndex (resource-wide list).
  59.    If they are 10, then bits 0-13 are an index in UCKeySequenceDataIndex (resource-wide list),
  60.      or if UCKeySequenceDataIndex is not present or the index is beyond the end of the list,
  61.      then bits 0-15 are a single Unicode character.
  62.    Otherwise, bits 0-15 are a single Unicode character; a value of 0xFFFE-0xFFFF means no character
  63.      output.
  64.    UCKeyCharSeq is similar, but does not support indices in UCKeyStateRecordsIndex. For bits 15-14:
  65.    If they are 10, then bits 0-13 are an index in UCKeySequenceDataIndex (resource-wide list),
  66.      or if UCKeySequenceDataIndex is not present or the index is beyond the end of the list,
  67.      then bits 0-15 are a single Unicode character.
  68.    Otherwise, bits 0-15 are a single Unicode character; a value of 0xFFFE-0xFFFF means no character
  69.      output.
  70.    -------------------------------------------------------------------------------------------------
  71. */
  72.  
  73. typedef UInt16                             UCKeyOutput;
  74. typedef UInt16                             UCKeyCharSeq;
  75. enum {
  76.     kUCKeyOutputStateIndexMask    = 0x4000,
  77.     kUCKeyOutputSequenceIndexMask = 0x8000,
  78.     kUCKeyOutputTestForIndexMask = 0xC000,                        /* test bits 14-15*/
  79.     kUCKeyOutputGetIndexMask    = 0x3FFF                        /* get bits 0-13*/
  80. };
  81.  
  82. /*
  83.    -------------------------------------------------------------------------------------------------
  84.    UCKeyStateRecord & related stuff
  85.    The UCKeyStateRecord information is used as follows. If the current state is zero,
  86.    output stateZeroCharData and set the state to stateZeroNextState. If the current state
  87.    is non-zero and there is an entry for it in stateEntryData, then output the corresponding
  88.    charData and set the state to nextState. Otherwise, output the state terminator from
  89.    UCKeyStateTerminators for the current state (or nothing if there is no UCKeyStateTerminators
  90.    table or it has no entry for the current state), then output stateZeroCharData and set the
  91.    state to stateZeroNextState.
  92.    -------------------------------------------------------------------------------------------------
  93. */
  94.  
  95.  
  96. struct UCKeyStateRecord {
  97.     UCKeyCharSeq                     stateZeroCharData;
  98.     UInt16                             stateZeroNextState;
  99.     UInt16                             stateEntryCount;
  100.     UInt16                             stateEntryFormat;
  101.                                                                 /* This is followed by an array of stateEntryCount elements*/
  102.                                                                 /* in the specified format. Here we just show a dummy array.*/
  103.     UInt32                             stateEntryData[1];
  104. };
  105. typedef struct UCKeyStateRecord            UCKeyStateRecord;
  106. /*
  107.    Here are the codes for entry formats currently defined.
  108.    Each entry maps from curState to charData and nextState.
  109. */
  110. enum {
  111.     kUCKeyStateEntryTerminalFormat = 0x0001,
  112.     kUCKeyStateEntryRangeFormat    = 0x0002
  113. };
  114.  
  115. /*
  116.    For UCKeyStateEntryTerminal -
  117.    nextState is always 0, so we don't have a field for it
  118. */
  119.  
  120.  
  121. struct UCKeyStateEntryTerminal {
  122.     UInt16                             curState;
  123.     UCKeyCharSeq                     charData;
  124. };
  125. typedef struct UCKeyStateEntryTerminal    UCKeyStateEntryTerminal;
  126. /*
  127.    For UCKeyStateEntryRange -
  128.    If curState >= curStateStart and curState <= curStateStart+curStateRange,
  129.    then it matches the entry, and we transform charData and nextState as follows:
  130.    If charData < 0xFFFE, then charData += (curState-curStateStart)*deltaMultiplier
  131.    If nextState != 0, then nextState += (curState-curStateStart)*deltaMultiplier
  132. */
  133.  
  134. struct UCKeyStateEntryRange {
  135.     UInt16                             curStateStart;
  136.     UInt8                             curStateRange;
  137.     UInt8                             deltaMultiplier;
  138.     UCKeyCharSeq                     charData;
  139.     UInt16                             nextState;
  140. };
  141. typedef struct UCKeyStateEntryRange        UCKeyStateEntryRange;
  142. /*
  143.    -------------------------------------------------------------------------------------------------
  144.    UCKeyboardLayout & related stuff
  145.    The UCKeyboardLayout struct given here is only for the resource header. It specifies
  146.    offsets to the various subtables which each have their own structs, given below.
  147.    The keyboardTypeHeadList array selects table offsets that depend on keyboardType. The
  148.    first entry in keyboardTypeHeadList is the default entry, which will be used if the
  149.    keyboardType passed to UCKeyTranslate does not match any other entry - i.e. does not fall
  150.    within the range keyboardTypeFirst..keyboardTypeLast for some entry. The first entry
  151.    should have keyboardTypeFirst = keyboardTypeLast = 0.
  152.    -------------------------------------------------------------------------------------------------
  153. */
  154.  
  155. struct UCKeyboardTypeHeader {
  156.     UInt32                             keyboardTypeFirst;            /* first keyboardType in this entry*/
  157.     UInt32                             keyboardTypeLast;            /* last keyboardType in this entry*/
  158.     ByteOffset                         keyModifiersToTableNumOffset; /* required*/
  159.     ByteOffset                         keyToCharTableIndexOffset;    /* required*/
  160.     ByteOffset                         keyStateRecordsIndexOffset;    /* 0 => no table*/
  161.     ByteOffset                         keyStateTerminatorsOffset;    /* 0 => no table*/
  162.     ByteOffset                         keySequenceDataIndexOffset;    /* 0 => no table*/
  163. };
  164. typedef struct UCKeyboardTypeHeader        UCKeyboardTypeHeader;
  165.  
  166. struct UCKeyboardLayout {
  167.                                                                 /* header only; other tables accessed via offsets*/
  168.     UInt16                             keyLayoutHeaderFormat;        /* =kUCKeyLayoutHeaderFormat*/
  169.     UInt16                             keyLayoutDataVersion;        /* 0x0100 = 1.0, 0x0110 = 1.1, etc.*/
  170.     ByteOffset                         keyLayoutFeatureInfoOffset;    /* may be 0                                    */
  171.     ItemCount                         keyboardTypeCount;            /* Dimension for keyboardTypeHeadList[]        */
  172.     UCKeyboardTypeHeader             keyboardTypeList[1];
  173. };
  174. typedef struct UCKeyboardLayout            UCKeyboardLayout;
  175. /* -------------------------------------------------------------------------------------------------*/
  176.  
  177. struct UCKeyLayoutFeatureInfo {
  178.     UInt16                             keyLayoutFeatureInfoFormat;    /* =kUCKeyLayoutFeatureInfoFormat*/
  179.     UInt16                             reserved;
  180.     UniCharCount                     maxOutputStringLength;        /* longest possible output string*/
  181. };
  182. typedef struct UCKeyLayoutFeatureInfo    UCKeyLayoutFeatureInfo;
  183. /* -------------------------------------------------------------------------------------------------*/
  184.  
  185. struct UCKeyModifiersToTableNum {
  186.     UInt16                             keyModifiersToTableNumFormat; /* =kUCKeyModifiersToTableNumFormat*/
  187.     UInt16                             defaultTableNum;            /* For modifier combos not in tableNum[]*/
  188.     ItemCount                         modifiersCount;                /* Dimension for tableNum[]*/
  189.     UInt8                             tableNum[1];
  190.  
  191.                                                                 /* Then there is padding to a 4-byte boundary with bytes containing 0, if necessary.*/
  192. };
  193. typedef struct UCKeyModifiersToTableNum    UCKeyModifiersToTableNum;
  194. /* -------------------------------------------------------------------------------------------------*/
  195.  
  196. struct UCKeyToCharTableIndex {
  197.     UInt16                             keyToCharTableIndexFormat;    /* =kUCKeyToCharTableIndexFormat*/
  198.     UInt16                             keyToCharTableSize;            /* Max keyCode (128 for ADB keyboards)*/
  199.     ItemCount                         keyToCharTableCount;        /* Dimension for keyToCharTableOffsets[] (usually 6 to 12 tables)*/
  200.     ByteOffset                         keyToCharTableOffsets[1];
  201.  
  202.                                                                 /* Each offset in keyToCharTableOffsets is from the beginning of the resource to a*/
  203.                                                                 /* table as follows:*/
  204.                                                                 /*    UCKeyOutput        keyToCharData[keyToCharTableSize];*/
  205.                                                                 /* These tables follow the UCKeyToCharTableIndex.*/
  206.                                                                 /* Then there is padding to a 4-byte boundary with bytes containing 0, if necessary.*/
  207. };
  208. typedef struct UCKeyToCharTableIndex    UCKeyToCharTableIndex;
  209. /* -------------------------------------------------------------------------------------------------*/
  210.  
  211. struct UCKeyStateRecordsIndex {
  212.     UInt16                             keyStateRecordsIndexFormat;    /* =kUCKeyStateRecordsIndexFormat*/
  213.     UInt16                             keyStateRecordCount;        /* Dimension for keyStateRecordOffsets[]*/
  214.     ByteOffset                         keyStateRecordOffsets[1];
  215.  
  216.                                                                 /* Each offset in keyStateRecordOffsets is from the beginning of the resource to a*/
  217.                                                                 /* UCKeyStateRecord. These UCKeyStateRecords follow the keyStateRecordOffsets[] array.*/
  218.                                                                 /* Then there is padding to a 4-byte boundary with bytes containing 0, if necessary.*/
  219. };
  220. typedef struct UCKeyStateRecordsIndex    UCKeyStateRecordsIndex;
  221. /* -------------------------------------------------------------------------------------------------*/
  222.  
  223. struct UCKeyStateTerminators {
  224.     UInt16                             keyStateTerminatorsFormat;    /* =kUCKeyStateTerminatorsFormat*/
  225.     UInt16                             keyStateTerminatorCount;    /* Dimension for keyStateTerminators[] (# of nonzero states)*/
  226.     UCKeyCharSeq                     keyStateTerminators[1];
  227.  
  228.                                                                 /* Note: keyStateTerminators[0] is terminator for state 1, etc.*/
  229.                                                                 /* Then there is padding to a 4-byte boundary with bytes containing 0, if necessary.*/
  230. };
  231. typedef struct UCKeyStateTerminators    UCKeyStateTerminators;
  232. /* -------------------------------------------------------------------------------------------------*/
  233.  
  234. struct UCKeySequenceDataIndex {
  235.     UInt16                             keySequenceDataIndexFormat;    /* =kUCKeySequenceDataIndexFormat*/
  236.     UInt16                             charSequenceCount;            /* Dimension of charSequenceOffsets[] is charSequenceCount+1*/
  237.     UInt16                             charSequenceOffsets[1];
  238.  
  239.                                                                 /* Each offset in charSequenceOffsets is in bytes, from the beginning of*/
  240.                                                                 /* UCKeySequenceDataIndex to a sequence of UniChars; the next offset indicates the*/
  241.                                                                 /* end of the sequence. The UniChar sequences follow the UCKeySequenceDataIndex.*/
  242.                                                                 /* Then there is padding to a 4-byte boundary with bytes containing 0, if necessary.*/
  243. };
  244. typedef struct UCKeySequenceDataIndex    UCKeySequenceDataIndex;
  245. /* -------------------------------------------------------------------------------------------------*/
  246. /* Current format codes for the various tables (bits 12-15 indicate which table)*/
  247.  
  248. enum {
  249.     kUCKeyLayoutHeaderFormat    = 0x1002,
  250.     kUCKeyLayoutFeatureInfoFormat = 0x2001,
  251.     kUCKeyModifiersToTableNumFormat = 0x3001,
  252.     kUCKeyToCharTableIndexFormat = 0x4001,
  253.     kUCKeyStateRecordsIndexFormat = 0x5001,
  254.     kUCKeyStateTerminatorsFormat = 0x6001,
  255.     kUCKeySequenceDataIndexFormat = 0x7001
  256. };
  257.  
  258.  
  259. /*
  260.    -------------------------------------------------------------------------------------------------
  261.    Constants for keyAction parameter in UCKeyTranslate() 
  262.    -------------------------------------------------------------------------------------------------
  263. */
  264.  
  265. enum {
  266.     kUCKeyActionDown            = 0,                            /* key is going down*/
  267.     kUCKeyActionUp                = 1,                            /* key is going up*/
  268.     kUCKeyActionAutoKey            = 2,                            /* auto-key down*/
  269.     kUCKeyActionDisplay            = 3                                /* get information for key display (as in Key Caps)            */
  270. };
  271.  
  272. /*
  273.    -------------------------------------------------------------------------------------------------
  274.    Bit assignments & masks for keyTranslateOptions parameter in UCKeyTranslate() 
  275.    -------------------------------------------------------------------------------------------------
  276. */
  277.  
  278. enum {
  279.     kUCKeyTranslateNoDeadKeysBit = 0                            /* Prevents setting any new dead-key states*/
  280. };
  281.  
  282. enum {
  283.     kUCKeyTranslateNoDeadKeysMask = 1L << kUCKeyTranslateNoDeadKeysBit
  284. };
  285.  
  286. /*
  287.    -------------------------------------------------------------------------------------------------
  288.    CONSTANTS & DATA STRUCTURES for Unicode Collation
  289.    -------------------------------------------------------------------------------------------------
  290. */
  291. typedef struct OpaqueCollatorRef*         CollatorRef;
  292.  
  293. typedef UInt32                             UCCollateOptions;
  294. enum {
  295.     kUCCollateComposeInsensitiveMask = 1L << 1,
  296.     kUCCollateWidthInsensitiveMask = 1L << 2,
  297.     kUCCollateCaseInsensitiveMask = 1L << 3,
  298.     kUCCollateDiacritInsensitiveMask = 1L << 4
  299. };
  300.  
  301. enum {
  302.     kUCCollateStandardOptions    = kUCCollateComposeInsensitiveMask | kUCCollateWidthInsensitiveMask
  303. };
  304.  
  305. /*
  306.    Special values to specify various invariant orders for UCCompareTextNoLocale.
  307.    These values use the high 8 bits of UCCollateOptions.
  308. */
  309. enum {
  310.     kUCCollateTypeHFSExtended    = 1
  311. };
  312.  
  313. /* These constants are used for masking and shifting the invariant order type.*/
  314. enum {
  315.     kUCCollateTypeSourceMask    = 0x000000FF,
  316.     kUCCollateTypeShiftBits        = 24
  317. };
  318.  
  319. enum {
  320.     kUCCollateTypeMask            = kUCCollateTypeSourceMask << kUCCollateTypeShiftBits
  321. };
  322.  
  323. typedef UInt32                             UCCollationValue;
  324. typedef struct OpaqueTextBreakLocatorRef*  TextBreakLocatorRef;
  325. /*
  326.    -------------------------------------------------------------------------------------------------
  327.    CONSTANTS & DATA STRUCTURES for Unicode TextBreak
  328.    -------------------------------------------------------------------------------------------------
  329. */
  330. typedef FourCharCode                     UCTextBreakType;
  331. enum {
  332.     kUCTextBreakCharType        = FOUR_CHAR_CODE('char'),
  333.     kUCTextBreakWordType        = FOUR_CHAR_CODE('word'),
  334.     kUCTextBreakLineType        = FOUR_CHAR_CODE('line')
  335. };
  336.  
  337. typedef UInt32                             UCTextBreakOptions;
  338. enum {
  339.     kUCTextBreakLeadingEdgeMask    = 1L << 0,
  340.     kUCTextBreakGoBackwardsMask    = 1L << 1
  341. };
  342.  
  343. /*
  344.    -------------------------------------------------------------------------------------------------
  345.    CONSTANTS & DATA STRUCTURES for Unicode Properties
  346.    -------------------------------------------------------------------------------------------------
  347. */
  348.  
  349. typedef SInt32                             UCCharPropertyType;
  350. enum {
  351.     kUCCharPropTypeGenlCategory    = 1,                            /* requests enumeration value*/
  352.     kUCCharPropTypeCombiningClass = 2,                            /* requests numeric value 0..255*/
  353.     kUCCharPropTypeBidiCategory    = 3                                /* requests enumeration value*/
  354. };
  355.  
  356. typedef UInt32                             UCCharPropertyValue;
  357. /* General Category enumeration values (requested by kUCCharPropTypeGenlCategory)*/
  358. enum {
  359.                                                                 /* Normative categories:*/
  360.     kUCGenlCatOtherNotAssigned    = 0,                            /* Cn Other, Not Assigned*/
  361.     kUCGenlCatOtherControl        = 1,                            /* Cc Other, Control*/
  362.     kUCGenlCatOtherFormat        = 2,                            /* Cf Other, Format*/
  363.     kUCGenlCatOtherSurrogate    = 3,                            /* Cs Other, Surrogate*/
  364.     kUCGenlCatOtherPrivateUse    = 4,                            /* Co Other, Private Use*/
  365.     kUCGenlCatMarkNonSpacing    = 5,                            /* Mn Mark, Non-Spacing*/
  366.     kUCGenlCatMarkSpacingCombining = 6,                            /* Mc Mark, Spacing Combining*/
  367.     kUCGenlCatMarkEnclosing        = 7,                            /* Me Mark, Enclosing*/
  368.     kUCGenlCatNumberDecimalDigit = 8,                            /* Nd Number, Decimal Digit*/
  369.     kUCGenlCatNumberLetter        = 9,                            /* Nl Number, Letter*/
  370.     kUCGenlCatNumberOther        = 10,                            /* No Number, Other*/
  371.     kUCGenlCatSeparatorSpace    = 11,                            /* Zs Separator, Space*/
  372.     kUCGenlCatSeparatorLine        = 12,                            /* Zl Separator, Line*/
  373.     kUCGenlCatSeparatorParagraph = 13,                            /* Zp Separator, Paragraph*/
  374.                                                                 /* Informative categories:*/
  375.     kUCGenlCatLetterUppercase    = 14,                            /* Lu Letter, Uppercase*/
  376.     kUCGenlCatLetterLowercase    = 15,                            /* Ll Letter, Lowercase*/
  377.     kUCGenlCatLetterTitlecase    = 16,                            /* Lt Letter, Titlecase*/
  378.     kUCGenlCatLetterModifier    = 17,                            /* Lm Letter, Modifier*/
  379.     kUCGenlCatLetterOther        = 18,                            /* Lo Letter, Other*/
  380.     kUCGenlCatPunctConnector    = 20,                            /* Pc Punctuation, Connector*/
  381.     kUCGenlCatPunctDash            = 21,                            /* Pd Punctuation, Dash*/
  382.     kUCGenlCatPunctOpen            = 22,                            /* Ps Punctuation, Open*/
  383.     kUCGenlCatPunctClose        = 23,                            /* Pe Punctuation, Close*/
  384.     kUCGenlCatPunctInitialQuote    = 24,                            /* Pi Punctuation, Initial quote*/
  385.     kUCGenlCatPunctFinalQuote    = 25,                            /* Pf Punctuation, Final quote*/
  386.     kUCGenlCatPunctOther        = 26,                            /* Po Punctuation, Other*/
  387.     kUCGenlCatSymbolMath        = 28,                            /* Sm Symbol, Math*/
  388.     kUCGenlCatSymbolCurrency    = 29,                            /* Sc Symbol, Currency*/
  389.     kUCGenlCatSymbolModifier    = 30,                            /* Sk Symbol, Modifier*/
  390.     kUCGenlCatSymbolOther        = 31                            /* So Symbol, Other*/
  391. };
  392.  
  393. /* Bidirectional Category enumeration values (requested by kUCCharPropTypeBidiCategory)*/
  394. enum {
  395.     kUCBidiCatNotApplicable        = 0,                            /* for now use this for unassigned*/
  396.                                                                 /* Strong types:*/
  397.     kUCBidiCatLeftRight            = 1,                            /* L  Left-Right*/
  398.     kUCBidiCatRightLeft            = 2,                            /* R  Right-Left*/
  399.                                                                 /* Weak types:*/
  400.     kUCBidiCatEuroNumber        = 3,                            /* EN European Number*/
  401.     kUCBidiCatEuroNumberSeparator = 4,                            /* ES European Number Separator*/
  402.     kUCBidiCatEuroNumberTerminator = 5,                            /* ET European Number Terminator*/
  403.     kUCBidiCatArabicNumber        = 6,                            /* AN Arabic Number*/
  404.     kUCBidiCatCommonNumberSeparator = 7,                        /* CS Common Number Separator*/
  405.                                                                 /* Separators:*/
  406.     kUCBidiCatBlockSeparator    = 8,                            /* B  Block Separator*/
  407.     kUCBidiCatSegmentSeparator    = 9,                            /* S  Segment Separator*/
  408.                                                                 /* Neutrals:*/
  409.     kUCBidiCatWhitespace        = 10,                            /* WS Whitespace*/
  410.     kUCBidiCatOtherNeutral        = 11                            /* ON Other Neutrals (unassigned codes could use this)*/
  411. };
  412.  
  413. /*
  414.    -------------------------------------------------------------------------------------------------
  415.    FUNCTION PROTOTYPES
  416.    -------------------------------------------------------------------------------------------------
  417. */
  418.  
  419. EXTERN_API( OSStatus )
  420. UCKeyTranslate                    (const UCKeyboardLayout * keyLayoutPtr,
  421.                                  UInt16                 virtualKeyCode,
  422.                                  UInt16                 keyAction,
  423.                                  UInt32                 modifierKeyState,
  424.                                  UInt32                 keyboardType,
  425.                                  OptionBits             keyTranslateOptions,
  426.                                  UInt32 *                deadKeyState,
  427.                                  UniCharCount             maxStringLength,
  428.                                  UniCharCount *            actualStringLength,
  429.                                  UniChar                 unicodeString[]);
  430.  
  431. /* Standard collation functions*/
  432. EXTERN_API_C( OSStatus )
  433. UCCreateCollator                (LocaleRef                 locale,
  434.                                  LocaleOperationVariant  opVariant,
  435.                                  UCCollateOptions         options,
  436.                                  CollatorRef *            collatorRef);
  437.  
  438. EXTERN_API_C( OSStatus )
  439. UCGetCollationKey                (CollatorRef             collatorRef,
  440.                                  const UniChar *        textPtr,
  441.                                  UniCharCount             textLength,
  442.                                  ItemCount                 maxKeySize,
  443.                                  ItemCount *            actualKeySize,
  444.                                  UCCollationValue         collationKey[]);
  445.  
  446. EXTERN_API_C( OSStatus )
  447. UCCompareCollationKeys            (const UCCollationValue * key1Ptr,
  448.                                  ItemCount                 key1Length,
  449.                                  const UCCollationValue * key2Ptr,
  450.                                  ItemCount                 key2Length,
  451.                                  Boolean *                equivalent,
  452.                                  SInt32 *                order);
  453.  
  454. EXTERN_API_C( OSStatus )
  455. UCCompareText                    (CollatorRef             collatorRef,
  456.                                  const UniChar *        text1Ptr,
  457.                                  UniCharCount             text1Length,
  458.                                  const UniChar *        text2Ptr,
  459.                                  UniCharCount             text2Length,
  460.                                  Boolean *                equivalent,
  461.                                  SInt32 *                order);
  462.  
  463. EXTERN_API_C( OSStatus )
  464. UCDisposeCollator                (CollatorRef *            collatorRef);
  465.  
  466. /* Simple collation using default locale*/
  467.  
  468. EXTERN_API_C( OSStatus )
  469. UCCompareTextDefault            (UCCollateOptions         options,
  470.                                  const UniChar *        text1Ptr,
  471.                                  UniCharCount             text1Length,
  472.                                  const UniChar *        text2Ptr,
  473.                                  UniCharCount             text2Length,
  474.                                  Boolean *                equivalent,
  475.                                  SInt32 *                order);
  476.  
  477.  
  478. /* Simple locale-independent collation*/
  479.  
  480. EXTERN_API_C( OSStatus )
  481. UCCompareTextNoLocale            (UCCollateOptions         options,
  482.                                  const UniChar *        text1Ptr,
  483.                                  UniCharCount             text1Length,
  484.                                  const UniChar *        text2Ptr,
  485.                                  UniCharCount             text2Length,
  486.                                  Boolean *                equivalent,
  487.                                  SInt32 *                order);
  488.  
  489. /* Standard text break (text boundary) functions*/
  490. EXTERN_API_C( OSStatus )
  491. UCCreateTextBreakLocator        (LocaleRef                 locale,
  492.                                  LocaleOperationVariant  opVariant,
  493.                                  UCTextBreakType         breakType,
  494.                                  TextBreakLocatorRef *    breakRef);
  495.  
  496. EXTERN_API_C( OSStatus )
  497. UCFindTextBreak                    (TextBreakLocatorRef     breakRef,
  498.                                  UCTextBreakOptions     options,
  499.                                  const UniChar *        textPtr,
  500.                                  UniCharCount             textLength,
  501.                                  UniCharCount             startOffset,
  502.                                  UniCharCount *            breakOffset);
  503.  
  504. EXTERN_API_C( OSStatus )
  505. UCDisposeTextBreakLocator        (TextBreakLocatorRef *    breakRef);
  506.  
  507. /* Standard Unicode properties functions*/
  508.  
  509. EXTERN_API_C( OSStatus )
  510. UCGetCharProperty                (const UniChar *        charPtr,
  511.                                  UniCharCount             textLength,
  512.                                  UCCharPropertyType     propType,
  513.                                  UCCharPropertyValue *    propValue);
  514.  
  515.  
  516. #if PRAGMA_STRUCT_ALIGN
  517.     #pragma options align=reset
  518. #elif PRAGMA_STRUCT_PACKPUSH
  519.     #pragma pack(pop)
  520. #elif PRAGMA_STRUCT_PACK
  521.     #pragma pack()
  522. #endif
  523.  
  524. #ifdef PRAGMA_IMPORT_OFF
  525. #pragma import off
  526. #elif PRAGMA_IMPORT
  527. #pragma import reset
  528. #endif
  529.  
  530. #ifdef __cplusplus
  531. }
  532. #endif
  533.  
  534. #endif /* __UNICODEUTILITIES__ */
  535.  
  536.